package com.xy.yunduo.utils.response;

import com.xy.yunduo.utils.http.HttpUtil;
import org.springframework.web.servlet.support.RequestContext;

import javax.servlet.http.HttpServletRequest;

public class MessageHolder {
    public static String get(String code) {
        HttpServletRequest request = HttpUtil.getHttpServletRequest();

        RequestContext requestContext = new RequestContext(request);
        try {
            return requestContext.getMessage(code);
        } catch (Exception e) {
            e.printStackTrace();
            return code;
        }
    }
}
